package univer.oko.database.rmi.impl;


import java.util.Vector;

/**
 * @author Eduard Dudar
 *         Date: 21.11.2005
 *         Time: 22:00:09
 */
public class PaymentTypeImpl extends ImplHelper {
    public PaymentTypeImpl(RMIImpl rmi) {
        super(rmi);
    }

    public Vector getAllPaymentTypes() {
        return this.getVectorValue("SELECT PaymentType_Name FROM Payment_Type");
    }

    public Vector getPaymentTypes() {
        return this.getVectorValue("SELECT PaymentType_Name FROM Payment_Type WHERE ID_PaymentType <> 3");
    }

    public Integer getPaymentTypeID(String str) {
        return this.getIntValue("SELECT ID_PaymentType FROM Payment_Type WHERE PaymentType_Name = '" + str + "'");
    }

    public String getPaymentTypeName(int id) {
        return this.getStringValue("SELECT PaymentType_Name FROM Payment_Type WHERE ID_PaymentType = " + id);
    }

    public String getPaymentTypeNameByReason(String reasonName) {
        return this.getStringValue("SELECT PaymentType_Name FROM Payment_Type,Reason WHERE ref_PaymentType=id_PaymentType AND reason_Name= '" + reasonName + "'");
    }

    public String getPaymentTypeNameByReason(int idReason) {
        return this.getStringValue("SELECT PaymentType_Name FROM Payment_Type,Reason WHERE ref_PaymentType=id_PaymentType AND id_reason=" + idReason);
    }
}
